/** This file is part of MonFS. **
 * 
 * MonFS: File system for monitoring file I/O operations
 * 
 * Copyright (C) 2010 Hitoshi Sato <hitoshi.sato@gmail.com>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */

#ifndef HASH_H_
#define HASH_H_

int hash_default(const void *, int);
int hash_key_equal_default(const void *, int, const void *, int);

struct hash_table;
struct hash_entry;	

struct hash_table * hash_table_alloc(int,
		int (*)(const void *, int),
		int (*)(const void *, int, const void *, int));
void hash_table_free(struct hash_table *);
struct hash_entry * hash_lookup(struct hash_table *, const void *, int);
struct hash_entry * hash_enter(struct hash_table *, const void *, int, int, int *);
int hash_purge(struct hash_table *, const void *, int);

void *hash_entry_key(struct hash_entry *);
int hash_entry_key_length(struct hash_entry *);
void *hash_entry_data(struct hash_entry *);
int hash_entry_data_length(struct hash_entry *);

#endif /* HASH_H_*/
